namespace yiCommerce.Data.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class friendship : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.FriendShip",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        OwnerId = c.Int(nullable: false),
                        FriendId = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.Customer", t => t.OwnerId)
                .ForeignKey("dbo.Customer", t => t.FriendId)
                .Index(t => t.OwnerId)
                .Index(t => t.FriendId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.FriendShip", new[] { "FriendId" });
            DropIndex("dbo.FriendShip", new[] { "OwnerId" });
            DropForeignKey("dbo.FriendShip", "FriendId", "dbo.Customer");
            DropForeignKey("dbo.FriendShip", "OwnerId", "dbo.Customer");
            DropTable("dbo.FriendShip");
        }
    }
}
